<?php

namespace App\Models;

use Dcat\Admin\Traits\HasDateTimeFormatter;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\Model;

class UserDangan extends Model
{
	use HasDateTimeFormatter;
    use SoftDeletes;

    protected $table = 'user_dangans';
    protected $casts = [
        // 'shili_luoyan_left'=>'json',
        // 'shili_luoyan_right'=>'json',
        // 'shili_jiaozheng_left'=> 'json',
        // 'shili_jiaozheng_right'=>'json',
        'yanguang_diannao_left'=>'json',
        'yanguang_diannao_right'=>'json',
        'yanguang_zonghe_left'=>'json',
        'yanguang_zonghe_right'=>'json',
        'jiujing_jiaodu_left'=> 'json',
        'jiujing_jiaodu_right'=> 'json',
        // 'yanzhu_left'=>'json',
        // 'yanzhu_right'=>'json',
        // 'qulv_left'=>'json',
        // 'qulv_right'=>'json',
        // 'yanwei_left'=>'json',
        // 'yanwei_right'=>'json',
        // 'yandi_left'=>'json',   
        // 'yandi_right'=>'json',
        // 'duibidu_left'=>'json',
        // 'duibidu_right'=>'json',
        // 'shuangyan_fuxiang_left'=>'json',
        // 'shuangyan_fuxiang_right'=>'json',
        // 'shuangyan_tiaojie_left'=>'json',
        // 'shuangyan_tiaojie_right'=>'json',
        // 'shuangyan_zhengxiang_left'=>'json',
        'fangan_jiaozheng'=>'json',
        'fangan_xunlian'=>'json',
        'ganyu'=>'json'
    ];

    

    public function user(){
        return $this->hasOne(User::class, 'id', 'user_id');
    }

    public function wj(){
        return $this->hasOne(UserWenjuan::class, 'dangan_id', 'id');
    }


    
}
